import request from '@/utils/request'

export function listData(params) {
  return request({
    url: '/room/list',
    method: 'get',
    params
  })
}

export function listDetailData(id) {
  return request({
    url: `/room/detail/${id}`,
    method: 'get'
  })
}

export function putEditData(id, form) {
  return request({
    url: `/room/update/detail/${id}`,
    method: 'put',
    data: form
  })
}

export function getRoomWater(query) {
  return request({
    url: `/room/income${query}`,
    method: 'get'
  })
}

export function resetRoomAudit(form) {
  return request({
    url: `room/audit/cancel`,
    method: 'post',
    data: form
  })
}

export function postCreateHall(form) {
  return request({
    url: `/room/create/hall`,
    method: 'post',
    data: form
  })
}

export function postSendPopularity(id, form) {
  return request({
    url: `/room/send/popularity/${id}`,
    method: 'post',
    data: form
  })
}

export function postBanRoom(form) {
  return request({
    url: `/room/ban`,
    method: 'post',
    data: form
  })
}

export function postCancelBanRoom(form) {
  return request({
    url: `/room/unlock`,
    method: 'post',
    data: form
  })
}

export function postSetWater(id, form) {
  return request({
    url: `/room/water-ratio/set/${id}`,
    method: 'post',
    data: form
  })
}

export function deleteData(query) {
  return request({
    url: '/room/delete',
    method: 'delete',
    data: query
  })
}

export function getTypearr(query) {
  return request({
    url: `/room/typearr${query}`,
    method: 'get'
  })
}

export function getLabelarr(query) {
  return request({
    url: `/room/labelarr${query}`,
    method: 'get'
  })
}

export function getExportExcel(query) {
  return request({
    url: `/room/export${query}`,
    method: 'get'
  })
}

export function saveData(form) {
  return request({
    url: '/nobility/add',
    method: 'post',
    data: form
  })
}

export function updateData(form) {
  return request({
    url: '/nobility/save',
    method: 'post',
    data: form
  })
}

export function batchResetPop(form) {
  return request({
    url: '/room/init-popularity',
    method: 'post',
    data: form
  })
}

export function recommendRoom(form) {
  return request({
    url: '/room/recommend',
    method: 'post',
    data: form
  })
}

export function cancelRecommendRoom(form) {
  return request({
    url: '/room/cancel-recommend',
    method: 'post',
    data: form
  })
}

//
// export function topRoom(form) {
//   return request({
//     url: '/room/top',
//     method: 'post',
//     data: form
//   })
// }

export function TopRoom(form) {
  return request({
    url: '/room/stick-top',
    method: 'post',
    data: form
  })
}
